[MTR04] W2 D12 練習三


Posted by Christy on 2020-07-16

練習三:寫一個能夠印出 n 個 的函式
寫一個函式 star,接收一個參數 n,並印出 n 個

(禁止使用內建函式 repeat)

star(1) 預期輸出:
*

star(5) 預期輸出:


star(10) 預期輸出:


function star(n){
 for (i = 1; i<=n; i++) {
}
console.log(star(1))

中間少了星星,應該有要擺的地方,明天繼續研究。










Related Posts

Sorting Band Names without articles

Sorting Band Names without articles

Node.js Advanced Interview Questions for Experienced Professionals

Node.js Advanced Interview Questions for Experienced Professionals

Learn React with react.dev

Learn React with react.dev


Comments